let message:string = "今天圣诞节"
console.log(message);
let bool:boolean = true
let age:number = 23

//联合类型 msg数据类型允许支持多个
let msg:string | undefined;
let address:string | null;
address = null

/**
 * 数组类型
 */
let array:number[] = [1,2,3,4]
let array2:string[] = ["1","2","3"]
//定义数组语法二
let array3:Array<number> = [3,4,5,6]

/**
 * 元组类型：数组的一种扩展。要求你对数组中每一位都进行单独约束
 * 元组类型用于特定的一种场景
 */
let user:[number,string,boolean] = [1,"xiaowang",true]

/**
 * 
 * 枚举概念：将代码中一些不可读的值，提取出来，用枚举表现。代码中用枚举变量替代
 * 枚举的类型是有限个数的。一年四季、一年月份、支付状态
 *
 */
enum OrderStatus {payError=1,paySuccess=2,payTimeout=3,canclePay=4}
let order = {
    id:1,
    type:"普通订单",
    status:0
}

if(order.status == OrderStatus.payError ){
    //console.log("支付失败")
}else if(order.status == OrderStatus.paySuccess ){
    //console.log("支付成功")

}else {

}

/**
 * any
 */
const app:any = document.getElementById("app")
let app2:any = "1234"
let app3:any = 1

/**
 * Object类型，可以表示数组、对象、函数
 */
let temp1:object =[]
let temp2:object = {}
let temp3:object = function(){}

let teacher:{id:number,name:string,address:string} = {id:1,name:"bo",address:"南京"}









